package com.linkage.jz.bankruptcy.activity.Project;

import android.app.ActionBar;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.linkage.jz.bankruptcy.R;
import com.linkage.jz.bankruptcy.activity.MainActivity;
import com.linkage.jz.bankruptcy.activity.Person.PersonSettingReadMeActivity;
import com.linkage.jz.bankruptcy.activity.RegistLogin.GetPwdOneActivity;
import com.linkage.jz.bankruptcy.activity.RegistLogin.PhoneLoginActivity;
import com.linkage.jz.bankruptcy.base.BaseActivity;
import com.linkage.jz.bankruptcy.fragment.Project.FavProFragment;
import com.linkage.jz.bankruptcy.fragment.Project.PublicProFragment;
import com.linkage.jz.bankruptcy.widget.ShapeLoadingDialog;

import java.util.ArrayList;


/**
 * A login screen that offers login via email/password.
 */
public  class FavProListActivity extends BaseActivity implements OnClickListener{
    private static final String TAG = PersonSettingReadMeActivity.class.getSimpleName();

    @Override
    public void initData() {
    }

    @Override
    public void setListener() {
    }

    @Override
    public void initTitle() {
    }

    @Override
    public void initView() {
        top_title = findViewById(R.id.top_title);
        top_back = findViewById(R.id.top_back);
        top_mune = findViewById(R.id.top_mune);
        top_title.setText("关注项目");
        top_mune.setVisibility(View.INVISIBLE);
        top_back.setOnClickListener(this);
    }

    TextView top_title;
    Button top_back,top_mune;

    public static void start(Context context) {
        Intent intent = new Intent(context, FavProListActivity.class);
        context.startActivity(intent);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_main_myfav);
        super.onCreate(savedInstanceState);
        ActionBar bar = this.getActionBar();
        if(bar != null){
            bar.hide();
        }
        FavProFragment groupChildrenCollect = new FavProFragment();
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.content, groupChildrenCollect).commitAllowingStateLoss();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_login:
                //返回
                MainActivity.start(this);
                finish();
                break;
            case R.id.ll_phonelogin:
                PhoneLoginActivity.start(this);
                finish();
                break;
            case R.id.top_back:
                finish();
                break;
            case R.id.getPwd:
                GetPwdOneActivity.start(this);
            default:
                break;
        }
    }
}


